package bit.springaopdemo.controller;

import bit.springaopdemo.aspect.MyAspect;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/test1")
public class TestController {


    @RequestMapping("/t1")//连接点
    public Integer t1(){
        log.info("执行t1");
        int a=10/0;
        log.info("执行t1后");
        return 1;
    }

    @MyAspect
    @RequestMapping("/t2")//连接点...
    public String t2(){
        log.info("执行t2");
        log.info("执行t2后");
        return "t2";
    }

    @RequestMapping("/t3")
    public Boolean t3(){
        log.info("执行t3");
        log.info("执行t3后");
        return true;
    }
}
